{extend name="admin@index_layout"/}
{block name="main"}
<style type="text/css">
    .childrenBody {
        background: #fff;
    }
</style>
<!--<style type="text/css">-->
<!--    .layui-layer-page .layui-layer-content {-->
<!--        overflow: inherit;-->
<!--    }-->
<!--</style>-->

<script type="text/html" id="barTool">

    <a data-open='{:url("detail2")}?business_id={{d.business_id}}&date={{d.date}}' class="layui-btn layui-btn-xs  {:$auth->check('count.business/detail')?'':'layui-hide'}" title="销售详情">本月销售详情</a>
    {{# if(d.is_kai==0){ }}
    <a href="javascript:;" onclick="wk.confirm('{{d.id}}','{:url('kai')}?business_id={{d.business_id}}&date={{d.date}}&count_amount={{d.count_amount}}','确认开票？')"
       class="layui-btn layui-btn-danger layui-btn-xs" title="确认开票">确认开票</a>
    {{# } }}

</script>

<div class="layui-card">
    <div class="layui-card-header">服务站核销发票</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
    </div>
</div>
<script type="text/html" id="picTpl">
    <img style="max-width:80px; max-height:30px;" src="{{d.img}}" data-image="{{d.name}}">
</script>

{/block}
{block name="script"}
<script>
    layui.use(['table', 'yznTable','jquery'], function () {
        // var table = layui.table,
            $ = layui.$;
        //     form = layui.form,
        //     table = layui.table,
        var table = layui.yznTable;

        var init = {
            table_elem: '#currentTable',
            add_url: "{:url('add',['catid'=>$catid])}",
            delete_url: "{:url('del',['catid'=>$catid])}",
            modify_url: '{:url("listorder",["catid"=>$catid])}',
        };
        table.render({
            init: init,
            id: 'currentTable',
            elem: '#currentTable',
            url: '{:url("detail")}?business_id={$business_id}',
            search: false,
            // searchFormTpl:false,
            toolbar: ['refresh',
            ],
            cols: [
                [
                    // {type: 'checkbox', fixed: 'left'},
                    {field: 'id', width: 60, title: 'ID',search: false},
                    {field: 'date', Width: 20, align: "center", title: '日期',search: false},
                    {field: 'business_id', Width: 20, align: "center", title: 'business_id',hide: true},
                    {field: 'count_amount', Width: 20, align: "center", title: '总计金额',search: false},
                    {field: 'is_kai', Width: 20, align: "center", title: '是否开票',templet: function (d) {
                        if(d.is_kai==1){
                            return '<span style="color: black">已开票</span>';
                        }else{
                            return '<span style="color: #0000FF">未开票</span>';
                        }
                        },search: false},
                    {
                        fixed: 'right', align: 'center', Width: 20, title: '操作',
                        toolbar: '#barTool'
                    }
                ]
            ],
             page: {}
        });
        yznTable.bindevent();

        $(document).ready(function() {
            $("#layui-input-search").hide();
        });
    });
</script>
{/block}